public class ThreadName {
    public static void main(String[] args) {
        Thread thread = new Thread(()->{
            while (true){
                System.out.println("给线程取个名字!");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

            }
        },"线程一");
        thread.start();
    }
}
